package main
/*
测试闭包的效果
*/
import (
	"fmt"
	"time"
)
var c int
func count() int{
	c++
	return c
}
func main() {
	a:=100
	go func(x,y int) {
		time.Sleep(time.Second)//让main先执行，
		fmt.Println("go:",x,y)
	}(a,count())//a变量的值已经被立即复制了 100   1

	a+=100
	fmt.Println("main",a,count()) //   200  2
	time.Sleep(time.Second*3)
}
